//-----------------------------------------------------------------------------
// Copyright (c) 2011 David Waby
// Initially created on 11/11/2011
//-----------------------------------------------------------------------------

#include "Global.h"
#include "Item.h"

//-----------------------------------------------------------------------------
void Item::Serialise(Json::Value * o_root ) const
{
}

//-----------------------------------------------------------------------------
void Item::Deserialise(Json::Value const * i_root)
{
	m_name = i_root->get("name", "null").asString();
	m_description = i_root->get("description", "null").asString();
	m_stackable = i_root->get("stackable", 1).asUInt();
	m_quality = static_cast<Quality::Enum>(i_root->get("quality", 0).asInt());
	m_equippable = static_cast<EquipableSlot::Enum>(i_root->get("equippable", 0).asInt());
	m_buyPrice = i_root->get("buyprice", 0).asInt();
	m_sellPrice = i_root->get("sellprice", 0).asInt();
	m_bind = static_cast<Bind::Enum>(i_root->get("bind", 0).asInt());
	m_requiredLevel = i_root->get("requiredLevel", 0).asUInt();
}